﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NIEN_LUAN
{
    public partial class FormReportHangTon : Form
    {
        private Db.DataContentDataContext db = new NIEN_LUAN.Db.DataContentDataContext();
        private FormThongKeHangTon frmThongkehangton;        

        public FormReportHangTon()
        {
            InitializeComponent();
        }

        public FormReportHangTon(FormThongKeHangTon frm)
        {
            InitializeComponent();
            frmThongkehangton = frm;
        }

        private void FormReportHangTon_Load(object sender, EventArgs e)
        {
            if (frmThongkehangton != null)
            {
                var list= frmThongkehangton.mATHANGBindingSource.DataSource as List<Db.Chitietchungtuthongke>;
                this.BindingSource.DataSource=list;
                this.reportViewer1.RefreshReport();
                return;

            }
            //var hangton = (from m in db.MATHANGs
            //                //where here
            //                //ở đ^ay anh select v^ề 1 chung tu thong ke
            //                select new Db.Chitietchungtuthongke
            //                {
            //                    MaHang=m.MaHang,
            //                    TenHang=m.TenHang,
            //                    DonGiaXuat=m.GiaBan??0,
            //                    GiaNhap=m.GiaNhap??0,
            //                    SoLuongTon=m.SoLuongHienCo??0,
            //                    MaLoaiHang=m.LOAIHANG.MaLoaiHang,
            //                    DonViTinh=m.DONVITINH.TenDonViTinh 
            //                }).ToList();
            //this.BindingSource.DataSource = hangton;
            //this.reportViewer1.RefreshReport();
        }
    }
}
